template-id `hash_set<Tool*>' used as a declarator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vasileios

    template-id `hash_set<Tool*>' used as a declarator

    Hello could someone help me please.


    I have the following class definition

    #include <ext/hash_set>
    #include "tool.h"

    class ToolContainer : public QObject
    {

    public:

    typedef std::hash_set<T ool*> ToolSet;
    ....
    ....
    ....


    and when I compile I get the following:


    toolcontainer.h :9: template-id `hash_set<Tool* >' used as a declarator
    toolcontainer.h :9: parse error before `;' token



    Any ideas why and how I could correct this error?

    I am using GCC 3.27

  • Rolf Magnus

    #2
    Re: template-id `hash_set&lt;To ol*&gt;' used as a declarator

    Vasileios wrote:
    [color=blue]
    > Hello could someone help me please.
    >
    >
    > I have the following class definition
    >
    > #include <ext/hash_set>
    > #include "tool.h"
    >
    > class ToolContainer : public QObject
    > {
    >
    > public:
    >
    > typedef std::hash_set<T ool*> ToolSet;
    > ...
    > ...
    > ...
    >
    >
    > and when I compile I get the following:
    >
    >
    > toolcontainer.h :9: template-id `hash_set<Tool* >' used as a declarator
    > toolcontainer.h :9: parse error before `;' token[/color]

    There is no standard template 'hash_set', so are you sure that it's in
    namespace std? It wouldn't be allowed to.
    [color=blue]
    > Any ideas why and how I could correct this error?
    >
    > I am using GCC 3.27[/color]

    There is no version 3.27 of gcc. See http://gcc.gnu.org/releases.html
    for a list of all gcc releases.

    Comment

    • Vasileios

      #3
      Re: template-id `hash_set&lt;To ol*&gt;' used as a declarator

      >>[color=blue][color=green]
      >>typedef std::hash_set<T ool*> ToolSet;[/color][/color]
      [color=blue]
      >
      > There is no standard template 'hash_set', so are you sure that it's in
      > namespace std? It wouldn't be allowed to.
      >
      >[/color]


      ok
      I tried with
      typedef hash_set<Tool*> ToolSet;

      but I get exactly the same error.


      V.Z.

      Comment

      • Rolf Magnus

        #4
        Re: template-id `hash_set&lt;To ol*&gt;' used as a declarator

        Vasileios wrote:
        [color=blue][color=green][color=darkred]
        >>>
        >>>typedef std::hash_set<T ool*> ToolSet;[/color][/color]
        >[color=green]
        >>
        >> There is no standard template 'hash_set', so are you sure that it's
        >> in namespace std? It wouldn't be allowed to.
        >>
        >>[/color]
        >
        >
        > ok
        > I tried with
        > typedef hash_set<Tool*> ToolSet;
        >
        > but I get exactly the same error.[/color]

        Ok, I had a look into gcc's has_set header (which you could have done
        easily too), and found out that hash_list is in namespace __gnu_cxx.


        Comment

        • Rolf Magnus

          #5
          Re: template-id `hash_set&lt;To ol*&gt;' used as a declarator

          Rolf Magnus wrote:
          [color=blue]
          > Vasileios wrote:
          >[color=green][color=darkred]
          >>>>
          >>>>typedef std::hash_set<T ool*> ToolSet;[/color]
          >>[color=darkred]
          >>>
          >>> There is no standard template 'hash_set', so are you sure that it's
          >>> in namespace std? It wouldn't be allowed to.
          >>>
          >>>[/color]
          >>
          >>
          >> ok
          >> I tried with
          >> typedef hash_set<Tool*> ToolSet;
          >>
          >> but I get exactly the same error.[/color]
          >
          > Ok, I had a look into gcc's has_set header (which you could have done
          > easily too), and found out that hash_list is in namespace __gnu_cxx.[/color]

          Sorry, of course I meant hash_set.

          Comment

          Working...